import pymysql
import traceback

connnection = {
    'host':'127.0.0.1',
    'user':'root',
    'password':'cpy50686868cpy',
    'database':'Prac'
}
try:
    conn = pymysql.connect(**connnection)
    c = conn.cursor()
    c.execute('select * from user')
    print(c.fetchall())
    # print(c.fetchmany(1))
except Exception:
    print('连接有误')
    print(traceback.print_exc())

